#include "MainFrame.h"

using namespace Capybara;

enum
{
    ID_Quit = 1,
    ID_About,
};

BEGIN_EVENT_TABLE(MainFrame, wxFrame)
    EVT_MENU(ID_Quit,  MainFrame::OnQuit)
    EVT_MENU(ID_About, MainFrame::OnAbout)
END_EVENT_TABLE()

MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
	: wxFrame((wxFrame*)NULL, -1, title, pos, size)
{
	wxMenu *menuFile = new wxMenu;

	menuFile->Append( ID_About, _("&About...") );
	menuFile->AppendSeparator();
	menuFile->Append( ID_Quit, _("E&xit") );

	wxMenuBar *menuBar = new wxMenuBar;
	menuBar->Append( menuFile, _("&File") );

	SetMenuBar( menuBar );

	CreateStatusBar();
	SetStatusText( _("Welcome to wxWidgets!") );
}

void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(e))
{
	Close( true );
}

void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(e))
{
	wxMessageBox( _("This is a wxWidgets' Hello world sample"),
		_("About Hello World"), wxOK | wxICON_INFORMATION );
}

